window.addEventListener('load', () => {
    if (window.navigator.serviceWorker) {
        const serviceWorker = window.navigator.serviceWorker;
        serviceWorker.register('./service-worker.js').then(registion => {
            console.log('注册成功', registion);
        }).catch(error => {
            console.log("注册失败")
        })
    }
})